﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Telerik.Windows.Controls;
namespace ControlBehavior
{
    public class ComboBoxBehaviors
    {
        public static void ComboBox_KeyUp(object sender, KeyEventArgs e, System.Collections.Generic.List<Control> list)
        {
            if (e.Key == Key.PageDown) {
                RadComboBox comboBox = sender as RadComboBox;
                comboBox.IsDropDownOpen = true;
                e.Handled = true;
            }
            else if (e.Key == Key.PageUp) 
            {
                RadComboBox comboBox = sender as RadComboBox;
                comboBox.IsDropDownOpen = false;
                e.Handled = true;
            }
            else if (e.Key == Key.Enter)
            {
                ControlBehavior.ControlBehaviors.Control_KeyUp(sender, e, list);
            }
        }

        public static void ComboBox_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.PageDown)
            {
                RadComboBox comboBox = sender as RadComboBox;
                comboBox.IsDropDownOpen = true;
                e.Handled = true;
            }
            else if (e.Key == Key.PageUp)
            {
                RadComboBox comboBox = sender as RadComboBox;
                comboBox.IsDropDownOpen = false;
                e.Handled = true;
            }
           
        }
    }
}
